import request from '@/utils/request'
const BASE_URL = '/admin/system/sysRole'
export default {
  getPageList(page, limit, searchObj) {
    return request({
      // url: '/admin/system/sysRole/' + page + '/' + limit,
      url: `${BASE_URL}/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  saveRole(role) {
    return request({
      url: `${BASE_URL}/addRole`,
      method: 'post', // 提交方式为 post
      data: role // 传递json 数据
    })
  },
  updateRole(role) {
    return request({
      url: `${BASE_URL}/updateRole`,
      method: 'post', // 提交方式为 post
      data: role
    })
  },
  removeId(id) {
    return request({
      url: `${BASE_URL}/deleteRole/${id}`,
      method: 'delete'
    })
  },
  getRoleById(id) {
    return request({
      url: `${BASE_URL}/findRoleById/${id}`,
      method: 'get'
    })
  },
  bactchremoveId(ids) {
    return request({
      url: `${BASE_URL}/batchRemove`,
      method: 'delete',
      data: ids
    })
  }
}
